Optimal. Leaf size=48 \[ -a^2 x-\frac {a^2 \cot (c+d x)}{d}-\frac {b^2 \cot (c+d x)}{d}-\frac {2 a b \csc (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3971, 3554, 8,
2686, 3852} \begin {gather*} -\frac {a^2 \cot (c+d x)}{d}+a^2 (-x)-\frac {2 a b \csc (c+d x)}{d}-\frac {b^2 \cot (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2686
Rule 3554
Rule 3852
Rule 3971
Rubi steps
\begin {align*} \int \cot ^2(c+d x) (a+b \sec (c+d x))^2 \, dx &=\int \left (a^2 \cot ^2(c+d x)+2 a b \cot (c+d x) \csc (c+d x)+b^2 \csc ^2(c+d x)\right ) \, dx\\ &=a^2 \int \cot ^2(c+d x) \, dx+(2 a b) \int \cot (c+d x) \csc (c+d x) \, dx+b^2 \int \csc ^2(c+d x) \, dx\\ &=-\frac {a^2 \cot (c+d x)}{d}-a^2 \int 1 \, dx-\frac {(2 a b) \text {Subst}(\int 1 \, dx,x,\csc (c+d x))}{d}-\frac {b^2 \text {Subst}(\int 1 \, dx,x,\cot (c+d x))}{d}\\ &=-a^2 x-\frac {a^2 \cot (c+d x)}{d}-\frac {b^2 \cot (c+d x)}{d}-\frac {2 a b \csc (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.41, size = 39, normalized size = 0.81 \begin {gather*} -\frac {\left (a^2+b^2\right ) \cot (c+d x)+a (a (c+d x)+2 b \csc (c+d x))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.08, size = 49, normalized size = 1.02
method | result | size |
risch | \(-a^{2} x -\frac {2 i \left (2 b a \,{\mathrm e}^{i \left (d x +c \right )}+a^{2}+b^{2}\right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}\) | \(47\) |
derivativedivides | \(\frac {-b^{2} \cot \left (d x +c \right )-\frac {2 b a}{\sin \left (d x +c \right )}+a^{2} \left (-\cot \left (d x +c \right )-d x -c \right )}{d}\) | \(49\) |
default | \(\frac {-b^{2} \cot \left (d x +c \right )-\frac {2 b a}{\sin \left (d x +c \right )}+a^{2} \left (-\cot \left (d x +c \right )-d x -c \right )}{d}\) | \(49\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 47, normalized size = 0.98 \begin {gather*} -\frac {{\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} a^{2} + \frac {2 \, a b}{\sin \left (d x + c\right )} + \frac {b^{2}}{\tan \left (d x + c\right )}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 4.64, size = 44, normalized size = 0.92 \begin {gather*} -\frac {a^{2} d x \sin \left (d x + c\right ) + 2 \, a b + {\left (a^{2} + b^{2}\right )} \cos \left (d x + c\right )}{d \sin \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right )^{2} \cot ^{2}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.44, size = 80, normalized size = 1.67 \begin {gather*} -\frac {2 \, {\left (d x + c\right )} a^{2} - a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {a^{2} + 2 \, a b + b^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.43, size = 58, normalized size = 1.21 \begin {gather*} \frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (a-b\right )}^2}{2\,d}-\frac {\frac {a^2}{2}+a\,b+\frac {b^2}{2}}{d\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}-a^2\,x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________